import request from '@/utils/request'

/**
 * @获取树形列表
 */
export function getTreeListAPI() {
  return request({
    url: '/company/department',
    method: 'get'
  })
}
/**
 *
 * @获取下拉菜单列表
 */
export function getSelectionsAPI() {
  return request({
    url: '/sys/user/simple'
  })
}
/**
 *
 * @新增部门
 */
export function addDepartmentAPI(data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}
/**
 *
 * @获取部门详情
 */
export function getDetailAPI(id) {
  return request({
    url: `/company/department/${id}`
  })
}
/**
 *
 * @编辑部门
 */
export function editAPI(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
/**
 *
 * @删除接口
 */
export function delDepartment(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}
